#pragma once
#include "PlayerDialog.h"

// MFCControlCtrl.h : Declaration of the CMFCControlCtrl ActiveX Control class.


// CMFCControlCtrl : See MFCControlCtrl.cpp for implementation.

class CMFCControlCtrl : public COleControl
{
	DECLARE_DYNCREATE(CMFCControlCtrl)

// Constructor
public:
	CMFCControlCtrl();

// Overrides
public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	virtual DWORD GetControlFlags();
// Implementation
protected:
	~CMFCControlCtrl();

	DECLARE_OLECREATE_EX(CMFCControlCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CMFCControlCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CMFCControlCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CMFCControlCtrl)		// Type name and misc status

// Message maps
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	DECLARE_DISPATCH_MAP()

// Event maps
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
		eventidOnPreviousTrack = 4L,
		eventidOnAddFile = 3L,
		eventidOnDelPlaylist = 2L,
		eventidOnNextTrack = 1L,
		dispidFilePlay = 1L,
	};
	CPlayerDialog m_PlayerDialog;
	CString m_FileName;
	bool IsHTML;

	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
protected:
	HRESULT FilePlay(BSTR* FilePath);
public:
	void OnNextTrack(void)
	{
		FireEvent(eventidOnNextTrack, EVENT_PARAM(VTS_NONE));
	}

	void OnDelPlaylist(void)
	{
		FireEvent(eventidOnDelPlaylist, EVENT_PARAM(VTS_NONE));
	}

	void OnAddFile(BSTR* FileName)
	{
		FireEvent(eventidOnAddFile, EVENT_PARAM(VTS_PBSTR), FileName);
	}

	void OnPreviousTrack(void)
	{
		FireEvent(eventidOnPreviousTrack, EVENT_PARAM(VTS_NONE));
	}
};

